package com.leapp.sk.ui.activity.classs

import android.os.Bundle
import com.example.mvp.activity.BaseActivityMVP
import com.example.mvp.binder.BaseDataBinder
import com.leapp.sk.R
import com.leapp.sk.binder.BaseBinder
import com.leapp.sk.inter.TopBarRightClickInterface
import com.example.util.finallist.CLASS_NICK
import com.leapp.sk.viewdelegate.classs.ModifyClassNameDelegate

/**
 * 修改班级名称
 * @author  chaohaipeng  on 2018/8/1.
 */
class ModifyClassNameASctivity : BaseActivityMVP<ModifyClassNameDelegate>(), TopBarRightClickInterface {
    override fun searchData() {
//        httpNameModify()

    }

    override fun initDate() {
        val groupName = intent?.getStringExtra(CLASS_NICK)
        viewDelegate.initEditText(groupName,this)

    }

    override fun initView(p0: Bundle?) {
        viewDelegate.setTitle(resources.getString(R.string.string_class_my_class_nick))

    }

    override fun bindEvenListener() {
    }

    override fun getDelegateClass(): Class<ModifyClassNameDelegate> {
        return ModifyClassNameDelegate::class.java
    }

    override fun getDataBinder(): BaseDataBinder<*, *> {
        return BaseBinder()
    }

//    /**
//     * 班级名称修改
//     */
//    private fun httpNameModify() {
//        val modifyClassNameRequestEntity = ModifyClassNameRequestEntity()
//        modifyClassNameRequestEntity.id=modifyClassNameRequestEntity.userId
//        modifyClassNameRequestEntity.className=viewDelegate.getSubmitContent()
//        LKHttp.post(CLASS_DETIAL_MODIFY, modifyClassNameRequestEntity, BaseResponseDataEntity::class.java, object : BaseCallBack<BaseResponseDataEntity>(this) {
//            override fun onSuccess(url: String?, resultText: String?, obj: BaseResponseDataEntity?) {
//                super.onSuccess(url, resultText, obj)
//                if (obj?.code == SKCODE_200) {
//                    val intent: Intent = Intent(this@ModifyClassNameASctivity, ClassDetialActivity::class.java)
//                    this@ModifyClassNameASctivity.intent.putExtra(CLASS_NICK,viewDelegate.getSubmitContent())
//                    this@ModifyClassNameASctivity.setResult(CODE_201,intent)
//                  finish()
//                }else{
//                    LKToastUtil.showToastShort(obj?.message)
//                }
//            }
//            override fun onFailure(url: String?, isLoading: Boolean, exceptionStr: String?) {
//                super.onFailure(url, isLoading, exceptionStr)
//                LKToastUtil.showToastShort(resources.getString(R.string.app_net_erro))
//            }
//        }
//                , true, Settings(MediaTypeWrap.MEDIA_TYPE_FORM))
//
//    }


}